package com.briup.jz.service.impl;

import com.briup.jz.bean.BaseRole;
import com.briup.jz.dao.BaseRoleMapper;
import com.briup.jz.dao.CertificationApplyMapper;
import com.briup.jz.service.IBaseRoleService;
import com.briup.jz.utils.CustomerException;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class BaseRoleServiceImpl implements IBaseRoleService {


    @Resource
    private BaseRoleMapper baseRoleMapper;



    @Override
    public void saveOrUpdat(BaseRole baseRole) throws CustomerException {

        if (baseRole.getId()!=null){
            //更新操作
            baseRoleMapper.updateByPrimaryKey(baseRole);
        }else {
            baseRoleMapper.insert(baseRole);
        }
    }

    @Override
    public BaseRole query(Long id) {

        return  baseRoleMapper.selectByPrimaryKey(id);
    }

    @Override
    public void deleteById(Long id) throws CustomerException {

        baseRoleMapper.deleteByPrimaryKey(id);
    }
}
